!function(I){
  let h={
    name:'myMusicAndroidBridge',
    ua: navigator.userAgent,
    init:function(){
      //通过requireJS引入jquery
      if (!(
        (void 0 !== I && this.isFunction(I) && this.isFunction(I.isPlainObject)) || 
        ('undefined' != typeof require &&
        this.isFunction(require) &&
        this.isFunction(require.config))
      )){
        let e = '';
        // let e = 'http://47.98.233.31/music'
        let  t = document.getElementsByTagName('head')[0];
        let a = document.getElementsByTagName('base')[0];
        a && (t = a.parentNode);
        let i = document.createElement('script');
        i.type = 'text/javascript';
        i.async = !0;
        i.addEventListener('load', function () {
          require.config({
            baseUrl: e,
            paths: {
              jquery: 'static/jquery-3.2.1.min',
            },
          }),
            require(['jquery'], function (e) {
              I = e
            })
        });
        i.src = e + '/static/require.js';
        a ? t.insertBefore(i, a) : t.appendChild(i)
      }
    },
    isFunction:function(e){
      return '[object Function]' === Object.prototype.toString.call(e);
    }
  }
  h.init.call(h);
  h.testBridge = function(a){
    if (I.isPlainObject(a) && void 0 !== a.param) {
      this.dispatch({
        fn: 'testBridge',
        src: a,
      })
    }
  };
  h.dispatch = function (a) {
    switch (a.fn) {
      case 'testBridge':
        let c = a.src;
        if (!I.isPlainObject(c) || void 0 === c.param){
          alert('参数不正确')
          break;
        }
        try {
          WebViewJavascriptBridge.callHandler(
            'submitFromWeb'
            , {'param': c.param}
            , function(responseData) {
                alert( "send get responseData from java, data = " + responseData);
            }
        );
        } catch (e) {
          console.log('testBridge出了一点问题')
        }
        break;
      
    }
  };
  (window.azBridge = h);
}(window.jQuery);